package com.iqiyi.pps.epg.api.server.iservice;

import com.iqiyi.mams.hedvig.http.mediatype.ExtendedMediaType;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;


/**
 * Created by karkarrotxu on 2017/3/2.
 */
@Path("/director")
@Produces({ExtendedMediaType.APPLICATION_X_THRIFT})
public interface ProgramDirectorApiService {


    @GET
    @Path("/test/msg")
    @Produces(MediaType.APPLICATION_JSON)
    public String testMsg();

    /* 添加导播  */
    @POST
    @Path("/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String addDirector(@FormParam("entity") String entity);

    /*导播列表 */
    @POST
    @Path("/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String listDirector(@FormParam("qipuId") String qipuId,
                               @FormParam("pname") String pname,
                               @FormParam("startDate") String startDate,
                               @FormParam("endDate") String endDate,
                               @FormParam("programStatus") String programStatus,
                               @FormParam("playStatus") String playStatus,
                               @FormParam("pageNo") Integer pageNo,
                               @FormParam("pageSize") Integer pageSize,
                               @FormParam("fullMode") String fullMode
    );

    @POST
    @Path("/start")
    @Produces(MediaType.APPLICATION_JSON)
    public String start(@FormParam("directorId") String directorId );

    @POST
    @Path("/stop")
    @Produces(MediaType.APPLICATION_JSON)
    public String stop(@FormParam("directorId") String directorId);

    @POST
    @Path("/edit")
    @Produces(MediaType.APPLICATION_JSON)
    public String edit(@FormParam("entity") String entity);


    @POST
    @Path("/enableBackup")
    @Produces(MediaType.APPLICATION_JSON)
    public String enableBackup();

    @POST
    @Path("/setMainResource")
    @Produces(MediaType.APPLICATION_JSON)
    public String setMainResource(@FormParam("pid") String pid, @FormParam("mainResourceId") String mainResourceId);

    @POST
    @Path("/resource/add")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceAdd(
            @FormParam("directorId") String directorId,
            @FormParam("programQipuId") String programQipuId,
            @FormParam("signalLegoId") String signalLegoId,
            @FormParam("signalType") String signalType,
            @FormParam("signalId") String signalId,
            @FormParam("isBackup") String isBackup,
            @FormParam("isDefaultBackup") String isDefaultBackup,
            @FormParam("signalName") String signalName,
            @FormParam("signalUrl") String signalUrl,
            @FormParam("signalPreviewUrl") String signalPreviewUrl
    );

    @POST
    @Path("/resource/edit")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceEdit(@FormParam("id") String id,
                               @FormParam("isDefaultBackup") String isDefaultBackup,
                               @FormParam("signalName") String signalName,
                               @FormParam("playStatus") String playStatus,
                               @FormParam("directorId") String directorId);

    @POST
    @Path("/resource/del")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceDel(@FormParam("id") String id, @FormParam("directorId") String directorId);

    @POST
    @Path("/resource/notice")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceNotice();

    @POST
    @Path("/resource/getList")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceGetList(@FormParam("directorId") String directorId,
                                  @FormParam("isBackup") String isBackup);

    @POST
    @Path("/resource/switch")
    @Produces(MediaType.APPLICATION_JSON)
    public String resourceSwitch(@FormParam("id") String id,
                                 @FormParam("directorId") String directorId,
                                 @FormParam("time") String time,
                                 @FormParam("playCounts") String playCounts);

    @POST
    @Path("/resource/setPlayCounts")
    @Produces(MediaType.APPLICATION_JSON)
    public String setResourcePlayCounts(@FormParam("id") String id,
                                 @FormParam("playCounts") Integer playCounts);

    @POST
    @Path("/log/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String getLogList(@FormParam("directorId") String directorId, @FormParam("pageNo") Integer pageNo,
                             @FormParam("pageSize") Integer pageSize);


    @POST
    @Path("/backup/switch")
    @Produces(MediaType.APPLICATION_JSON)
    public String switchBackUp(@FormParam("directorId")String directorId);

    @POST
    @Path("/releaseAll")
    @Produces(MediaType.APPLICATION_JSON)
    public String delDirector(@FormParam("directorId") String directorId);

    @POST
    @Path("/release")
    @Produces(MediaType.APPLICATION_JSON)
    public String releaseDirector(@FormParam("directorId") String directorId);

    @POST
    @Path("/effect/add")
    @Produces(MediaType.APPLICATION_JSON)
    String effectAdd(@FormParam("data") String data);

    @POST
    @Path("/effect/edit")
    @Produces(MediaType.APPLICATION_JSON)
    String effectEdit(
            @FormParam("id") int id,
            @FormParam("url") String url,
            @FormParam("name") String name,
            @FormParam("location") String location,
            @FormParam("extraInfo") String extraInfo,
            @FormParam("status") String status,
            @FormParam("directorId") String directorId,
            @FormParam("isPreview") int isPreview);

    @POST
    @Path("/effect/del")
    @Produces(MediaType.APPLICATION_JSON)
    String effectDelete(@FormParam("id") int id, @FormParam("directorId") String directorId);

    @GET
    @Path("/effect/list")
    @Produces(MediaType.APPLICATION_JSON)
    String effectList(@QueryParam("directorId") String directorId, @QueryParam("type") int type, @QueryParam("status") String status);

    // 请求转发
    @POST
    @Path("/redirect")
    @Produces(MediaType.APPLICATION_JSON)
    String redirectRequest(@FormParam("request") String request);

    @POST
    @Path("/commentary/add")
    @Produces(MediaType.APPLICATION_JSON)
    String commentaryAdd(@FormParam("name") String name,
                         @FormParam("programId") String programQipuId,
                         @FormParam("directorId") String directorId,
                         @FormParam("streamUrl") String streamUrl);

    @POST
    @Path("/commentary/edit")
    @Produces(MediaType.APPLICATION_JSON)
    String commentaryEdit(@FormParam("name") String name,
                          @FormParam("id") int id,
                          @FormParam("programId") String programQipuId,
                          @FormParam("directorId") String directorId,
                          @FormParam("streamUrl") String streamUrl,
                          @FormParam("volumn") String volumn,
                          @FormParam("status") String status);

    @GET
    @Path("/commentary/list")
    @Produces(MediaType.APPLICATION_JSON)
    String commentaryList(@QueryParam("directorId") String directorId,
                          @QueryParam("programId") String programQipuId,
                          @QueryParam("id") int id);

    @POST
    @Path("/commentary/del")
    @Produces(MediaType.APPLICATION_JSON)
    String commentaryDel(@FormParam("id") int id,
                         @FormParam("directorId") String directorId);

    @POST
    @Path("/resource/status")
    @Produces(MediaType.APPLICATION_JSON)
    String setDirectorResourceId(@FormParam("programQipuId") long programQipuId,
                                 @FormParam("playResouceId") int playResouceId,
                                 @FormParam("downResouceId") int downResourceId);


}

